<?php
/* ----------------------------------------------------------
--               JacoCMS by Jaco Ruit                      --
-------------------------------------------------------------
--     JacoCMS is Open Source and is lincenced under       --
--             GNU General Public Licence v3               --
--          http://www.gnu.org/copyleft/gpl.html           --
-------------------------------------------------------------
--       Please don't remove any text from the footers.    --
-------------------------------------------------------------
-- Credits:   * Jaco Ruit          ~     Scripts,MySQL     --     
-----------------------------------------------------------*/

# JacoCMS Settings Class

class Settings
{
	public function videoGalleryEnabled()
	{
		$query = "SELECT value FROM settings WHERE setting='VideoGalleryEnabled'";
		$result = mysql_query($query);
		while ($row = mysql_fetch_assoc($result)) 
		{
			$value = $row['value'];
		}
		mysql_free_result($result);
		if ($value == 0)
		{
			return false;
		}
		else if ($value == 1)
		{
			return true;
		}
		
		return false;
	}
	
	public function setVideoGallery ($value)
	{
		$query = "UPDATE settings SET value = '" . $value . "' WHERE setting='VideoGalleryEnabled'";
		$result = mysql_query($query);
	}
	
	public function loadStyle()
	{
		$query = "SELECT value FROM settings WHERE setting='Style'";
		$result = mysql_query($query);
		while ($row = mysql_fetch_assoc($result)) 
		{
			$value = $row['value'];
		}
		mysql_free_result($result);

		return $value;
	}
	
	public function setStyle ($value)
	{
		$query = "UPDATE settings SET value = '" . $value . "' WHERE setting='Style'";
		$result = mysql_query($query);
	}
	
	public function getWebsiteURL()
	{
		$query = "SELECT value FROM settings WHERE setting='WebsiteURL'";
		$result = mysql_query($query);
		while ($row = mysql_fetch_assoc($result)) 
		{
			$value = $row['value'];
		}
		mysql_free_result($result);

		return $value;
	}
	
	public function setWebsiteURL ($value)
	{
		$query = "UPDATE settings SET value = '" . $value . "' WHERE setting='WebsiteURL'";
		$result = mysql_query($query);
	}
	
	public function getWebsiteName()
	{
		$query = "SELECT value FROM settings WHERE setting='WebsiteName'";
		$result = mysql_query($query);
		while ($row = mysql_fetch_assoc($result)) 
		{
			$value = $row['value'];
		}
		mysql_free_result($result);

		return $value;
	}
	
	public function setWebsiteName ($value)
	{
		$query = "UPDATE settings SET value = '" . $value . "' WHERE setting='WebsiteName'";
		$result = mysql_query($query);
	}
	
}

?>